home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / dev / sun4c.md / devConfig.c < prev    next >
C/C++ Source or Header  |  1991-07-17  |  3KB  |  85 lines

  1. /* 
  2.  * devConfig.c --
  3.  *
  4.  *    Configuration table for the devices in the system.  There is
  5.  *    a table for the possible controllers in the system, and
  6.  *    then a table for devices.  Devices are implicitly associated
  7.  *    with a controller.  This file should be automatically generated
  8.  *    by a config program, but it isn't.
  9.  *
  10.  * Copyright 1989 Regents of the University of California
  11.  * Permission to use, copy, modify, and distribute this
  12.  * software and its documentation for any purpose and without
  13.  * fee is hereby granted, provided that the above copyright
  14.  * notice appear in all copies.  The University of California
  15.  * makes no representations about the suitability of this
  16.  * software for any purpose.  It is provided "as is" without
  17.  * express or implied warranty.
  18.  */
  19.  
  20. #ifndef lint
  21. static char rcsid[] = "$Header: /sprite/src/kernel/dev/sun4c.md/RCS/devConfig.c,v 1.4 91/07/17 11:48:04 jhh Exp $ SPRITE (Berkeley)";
  22. #endif not lint
  23.  
  24.  
  25. #include "sprite.h"
  26. #include "devAddrs.h"
  27. #include "devInt.h"
  28. #include "scsiC90.h"
  29. #include "devTypes.h"
  30. #include "scsiHBA.h"
  31.  
  32. /*
  33.  * Per device include files.
  34.  */
  35. /*
  36.  * The controller configuration table.
  37.  */
  38. DevConfigController devCntrlr[] = {
  39.    /* Name     Address,  Addr space, ID, InitProc   IntrVector  IntrRoutine. */
  40. #ifdef NOTDEF
  41. /* This seems already to be mapped at a virtual address. */
  42.    { "DMA_UNIT", DEV_DMA_ADDR, DEV_SBUS_OB, 0, (ClientData (*)()) NIL, 3,
  43.        DevSCSIC90Intr},
  44. #endif
  45.    { "SCSIC90", DEV_SCSI_ADDR, DEV_SBUS_OB, 0, DevSCSIC90Init, 3,
  46.        DevSCSIC90Intr},
  47. };
  48. /*
  49.  * We want to treat the dma controller and scsi device as the same device,
  50.  * but the both must be mapped separately, so we give them separate entries,
  51.  * but with only one init routine.
  52.  */
  53. int devNumConfigCntrlrs = sizeof(devCntrlr) / sizeof(DevConfigController);
  54. /*
  55.  * Table of SCSI HBA types attached to this system.
  56.  */
  57.  
  58. ScsiDevice *((*devScsiAttachProcs[]) _ARGS_((Fs_Device *devicePtr,
  59.         void (*insertProc) (List_Links *elementPtr,
  60.                     List_Links *elementListHdrPtr)))) = {
  61.     DevSCSIC90AttachDevice,        /* SCSI Controller type 0. */
  62. };
  63. int devScsiNumHBATypes = sizeof(devScsiAttachProcs) / 
  64.              sizeof(devScsiAttachProcs[0]);
  65. /*
  66.  * A list of disk devices that is used when probing for a root partition.
  67.  * The choices are:
  68.  * SCSI Disk target ID 0 LUN 0 partition 0 on SCSIC90 HBA 0. 
  69.  * SCSI Disk target ID 0 LUN 0 partition 2 on SCSIC90 HBA 0. 
  70.  * SCSI Disk target ID 0 LUN 0 partition 6 on SCSIC90 HBA 0. 
  71.  */
  72. Fs_Device devFsDefaultDiskPartitions[] = { 
  73.     { -1, SCSI_MAKE_DEVICE_TYPE(DEV_SCSI_DISK, DEV_SCSIC90_HBA, 0, 0, 0, 2),
  74.           SCSI_MAKE_DEVICE_UNIT(DEV_SCSI_DISK, DEV_SCSIC90_HBA, 0, 0, 0, 2),
  75.     (ClientData) NIL },
  76.     { -1, SCSI_MAKE_DEVICE_TYPE(DEV_SCSI_DISK, DEV_SCSIC90_HBA, 0, 0, 0, 0),
  77.           SCSI_MAKE_DEVICE_UNIT(DEV_SCSI_DISK, DEV_SCSIC90_HBA, 0, 0, 0, 0),
  78.     (ClientData) NIL },
  79.     { -1, SCSI_MAKE_DEVICE_TYPE(DEV_SCSI_DISK, DEV_SCSIC90_HBA, 0, 0, 0, 6),
  80.           SCSI_MAKE_DEVICE_UNIT(DEV_SCSI_DISK, DEV_SCSIC90_HBA, 0, 0, 0, 6),
  81.     (ClientData) NIL },
  82.   };
  83. int devNumDefaultDiskPartitions = sizeof(devFsDefaultDiskPartitions) / 
  84.               sizeof(Fs_Device);
  85.